#ifndef LIB_H
#define LIB_H

#include <stdint.h>

typedef enum LedType
{
	eRed,
	eGreen,
	eBlue
}LedType_t;
typedef enum LedCtrl
{
	eLedOff,
	eLedOn,
	eLedTwinkle
}LedCtrl_t;
typedef enum KeyNum
{
	eKey01,
	eKey02,
	eKey03,
	eKey04,
	eKey05,
	eKey06,
	eKey07,
	eKey08,
	eKey09,
	eKey10,
	eKey11,
	eKey12,
	eKey13,
	eKey14,
	eKey15,
	eKey16
}KeyNum_t;
typedef enum LockType
{
	SelfReset,		/*自复位*/
	SelfLock		/*自锁*/
}LockType_t;

void Lib_LockUnlockDataHandle(uint8_t *lastData,uint8_t *curData,uint8_t *dataOut,LockType_t lockType);


void Lib_Timer_Start(uint8_t *Is_Timer_Start);
uint16_t Lib_Timer_Stop(uint32_t *cur_time, uint8_t *Is_Timer_Start);
void Lib_Timer_Counter(uint32_t *cur_time, uint8_t Is_Timer_Start);

void Lib_FloatToU8(float  value,uint8_t *buf);
void Lib_FloatToU16(float  value,uint16_t *buf);
int Lib_memcmp(uint16_t* _Buf1,uint16_t* _Buf2,uint16_t len);
void Lib_memcpy(uint16_t* dest,uint16_t* src,uint16_t len);
void Lib_juge_holding_register_set_param(uint16_t regAddr,uint16_t len,uint8_t *setValid);

double Lib_moving_average_filter(uint8_t count,double new_value);
#endif
